<?php

class Application_Model_ContentCategory extends Common_Model {

    public $tableName = 'ContentCategory';

    public function getByCategory($cat) {

        $select = $this->db
                        ->select()->from('v_contentcategory')
                ->where(
                'categoryId ' . (is_array($cat) ? ' IN(' . implode(',', $cat
                        ) . ')' : '=' . $cat)
        );
        $result = $select->query();
        
        return $result ? $result->fetchAll(Zend_Db::FETCH_ASSOC) : array();
    }

}

